package com.sezi.blog.entity;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * 操作日志
 * @author yuanyi
 * @Date 2015-4-16
 * @version 1.0
 */
@Entity
@Table(name="b_operationlog")
public class OperationLog {
	
	/**id*/
	private Long id;
	/**操作用户*/
	private User opUser;
	/**操作类型*/
	private OperationType opType;
	/**操作时间*/
	private Date opTime;

	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@ManyToOne(fetch=FetchType.EAGER)
	public User getOpUser() {
		return opUser;
	}

	public void setOpUser(User opUser) {
		this.opUser = opUser;
	}

	@ManyToOne
	public OperationType getOpType() {
		return opType;
	}

	public void setOpType(OperationType opType) {
		this.opType = opType;
	}

	@Temporal(TemporalType.TIMESTAMP)
	public Date getOpTime() {
		return opTime;
	}

	public void setOpTime(Date opTime) {
		this.opTime = opTime;
	}
	
}
